/*    */ package com.zimbra.cs.mailclient.imap;
/*    */ 
/*    */ import java.io.IOException;
/*    */ import java.util.HashSet;
/*    */ import java.util.Iterator;
/*    */ import java.util.Set;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ImapCapabilities
/*    */ {
/* 28 */   private final Set<Atom> capabilities = new HashSet();
/*    */   public static final String IMAP4REV1 = "IMAP4rev1";
/*    */   public static final String STARTTLS = "STARTTLS";
/*    */   public static final String LOGINDISABLED = "LOGINDISABLED";
/*    */   public static final String IMAP4 = "IMAP4";
/*    */   public static final String LITERAL_PLUS = "LITERAL+";
/*    */   public static final String SASL_IR = "SASL-IR";
/*    */   public static final String UIDPLUS = "UIDPLUS";
/*    */   public static final String ID = "ID";
/*    */   public static final String IDLE = "IDLE";
/*    */   public static final String AUTH_PLAIN = "AUTH=PLAIN";
/*    */   public static final String AUTH_GSSAPI = "AUTH=GSSAPI";
/*    */   public static final String UNSELECT = "UNSELECT";
/*    */   
/*    */   public static ImapCapabilities read(ImapInputStream is) throws IOException
/*    */   {
/* 44 */     ImapCapabilities caps = new ImapCapabilities();
/* 45 */     caps.readCapabilities(is);
/* 46 */     return caps;
/*    */   }
/*    */   
/*    */   private void readCapabilities(ImapInputStream is)
/*    */     throws IOException
/*    */   {
/* 52 */     is.skipSpaces();
/* 53 */     while (Chars.isCapabilityChar(is.peekChar())) {
/* 54 */       addCapability(is.readChars(Chars.CAPABILITY_CHARS));
/* 55 */       is.skipSpaces();
/*    */     }
/*    */   }
/*    */   
/*    */   private void addCapability(String cap) {
/* 60 */     this.capabilities.add(new Atom(cap));
/*    */   }
/*    */   
/*    */   public boolean hasCapability(String cap) {
/* 64 */     return this.capabilities.contains(new Atom(cap));
/*    */   }
/*    */   
/*    */   public String toString() {
/* 68 */     StringBuilder sb = new StringBuilder("{");
/* 69 */     Iterator<Atom> it = this.capabilities.iterator();
/* 70 */     if (it.hasNext()) {
/* 71 */       sb.append(it.next());
/* 72 */       while (it.hasNext()) {
/* 73 */         sb.append(' ').append(it.next());
/*    */       }
/*    */     }
/* 76 */     return '}';
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/mailclient/imap/ImapCapabilities.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */